﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Netduino4Fun.DesktopAssistant.Windows.Views
{
	/// <summary>
	/// Interaction logic for Connect.xaml
	/// </summary>
	public partial class Connect : UserControl
	{
		public enum Connection
		{
			Serial,
			USB,
			Network
		}

		public Connect()
		{
			InitializeComponent();

			comboConnect.Items.Add(Connection.Serial);
			comboConnect.Items.Add(Connection.USB);
			comboConnect.Items.Add(Connection.Network);
			comboConnect.SelectedItem = Connection.Serial; 
		}
		 
		private void btConnect_Click(object sender, RoutedEventArgs e)
		{
			var con = (Connection) Enum.Parse(typeof (Connection), comboConnect.SelectedItem.ToString());
			if (con ==  Connection.Serial)
			{
				Netduino.Netduino.Instance.ConnectSerial();
			}
			else if (con == Connection.USB)
			{

			}
			else if (con == Connection.Network)
			{

			}
		}

	}
}
